from django.conf.urls import url
from users import views
from django.contrib.auth.decorators import login_required

urlpatterns=[
    #注册：函数视图　http://127.0.0.1:8000/users/register
    # url(r'^register$',views.register),

    #注册：类视图　http://127.0.0.1:8000/users/register
    url(r'^register$',views.RegisterView.as_view(),name='register'),

    #http://127.0.0.1:8000/users/active/user_id token就是混淆的user_id
    #激活：http://127.0.0.1:8000/users/active/!3242432ijhoih(*&^(*^*&%$^$&^&
    url(r'^active/(?P<token>.+)$',views.ActiveView.as_view(),name='active'),

    #登录http://127.0.0.1:8000/users/login
    url(r'^login$',views.LoginView.as_view(),name='login'),

    #退出登录
    url(r'^logout$',views.LogoutView.as_view(),name='logout'),

    #收货地址
    url(r'^address$',views.AddressView.as_view(),name='address'),
    #url(r'^address$',login_required(views.AddressView.as_view()),name='address')

    #个人信息
    url(r'^info$',views.UserInfoView.as_view(),name='info')



]